 package com.cxl.pattern.singleton;
 
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.PrintStream;
 import java.util.Properties;
 
 public class AppConfig
 {
   private static AppConfig instance = new AppConfig();
   private String parameterA;
   private String parameterB;
 
   public static AppConfig getInstance()
   {
     return instance;
   }
 
   public String getParameterA()
   {
     return this.parameterA;
   }
 
   public String getParameterB() {
     return this.parameterB;
   }
 
   private AppConfig() {
     readConfig();
   }
 
   private void readConfig() {
     try {
       Properties p = new Properties();
 
       InputStream in = AppConfig.class.getResourceAsStream("AppConfig.properties");
 
       p.load(in);
 
       this.parameterA = p.getProperty("parmA");
 
       this.parameterB = p.getProperty("parmB");
     }
     catch (IOException e) {
       System.err.println("转载配置文件出错了,具体堆栈信息如下:");
 
       e.printStackTrace();
     }
   }
 }

/* Location:           E:\work\eclipse3.6_\workspace\design_pattern\
 * Qualified Name:     com.cxl.pattern.singleton.AppConfig
 * JD-Core Version:    0.6.1
 */